Don't assume time_t can fit into int.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 2 Jun 2011 06:15:15 +0000 (23:15 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 2 Jun 2011 06:15:15 +0000 (23:15 -0700)
* buffer.h (struct buffer.modtime): Now time_t, not int.
* fileio.c (Fvisited_file_modtime): No need for time_t cast now.
* undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.

src/ChangeLog
src/buffer.h
src/fileio.c
src/undo.c

index 52b906a5d92edd74d14fd3d8ad27d15f881ef9c1..ea364368dca12ddd770309c5fa014d2df0098f69 100644 (file)
@@ -1,5 +1,10 @@
 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Don't assume time_t can fit into int.
+       * buffer.h (struct buffer.modtime): Now time_t, not int.
+       * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
+       * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
+
        Minor fixes for signed vs unsigned integers.
        * character.h (MAYBE_UNIFY_CHAR):
        * charset.c (maybe_unify_char):
index 2f33065cd1a24728d10e47b28056f5c83cf66c1a..8c64a24e8041bff2830dad0ac9d18aad8ae7d1f3 100644 (file)
@@ -545,7 +545,7 @@ struct buffer
      -1 means visited file was nonexistent.
      0 means visited file modtime unknown; in no case complain
      about any mismatch on next save attempt.  */
-  int modtime;
+  time_t modtime;
   /* Size of the file when modtime was set.  This is used to detect the
      case where the file grew while we were reading it, so the modtime
      is still the same (since it's rounded up to seconds) but we're actually
index 7e6fd8c82a8c2fb6015fe92df92fec9c6dc465ab..94894b97a6e226a267f563619ae761d665798920 100644 (file)
@@ -4990,7 +4990,7 @@ See Info node `(elisp)Modification Time' for more details.  */)
 {
   if (! current_buffer->modtime)
     return make_number (0);
-  return make_time ((time_t) current_buffer->modtime);
+  return make_time (current_buffer->modtime);
 }
 
 DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime,
index 80aff50d18abeebb4a540fe05743e4ce2750b303..142960545a79d3a68d6048c317bee66a1b69715a 100644 (file)
@@ -500,7 +500,7 @@ Return what remains of the list.  */)
                {
                  /* Element (t high . low) records previous modtime.  */
                  Lisp_Object high, low;
-                 int mod_time;
+                 time_t mod_time;
                  struct buffer *base_buffer = current_buffer;
 
                  high = Fcar (cdr);